<template>
  <el-row :gutter="20">
    <el-form label-width="80px" :model="form" ref="form">
      <el-col :span="6">
        <el-form-item label="名称" prop="roleName">
          <el-input v-model="form.roleName"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="角色代码" prop="roleCode">
          <el-input v-model="form.roleCode"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6" :offset="6" style="text-align: right">
        <el-button @click="handleSearch" type="primary">查询</el-button>
        <el-button @click="handleReset">重置</el-button>
      </el-col>
    </el-form>
  </el-row>
</template>

<script>
export default {
  data() {
    return {
      form: {
        roleName: '',
        roleCode: ''
      }
    };
  },
  methods: {
    handleSearch() {
      this.$emit('getTableData',{...this.form})
    },
    handleReset(){
      this.$refs.form.resetFields();
      this.$emit('getTableData',{...this.form})
    }
  }
}
</script>
